package logic

import (
	"context"
	"month_zh5/common/proto/goods"
	"month_zh5/service/server"
)

type GoodsServer struct {
	goods.UnimplementedGoodsServer
}

func (GoodsServer) PageViewsTop(ctx context.Context, in *goods.PageViewsTopRequest) (*goods.PageViewsTopResponse, error) {
	top, err := server.PageViewsTop(in)
	if err != nil {
		return nil, err
	}
	return top, err
}

func (GoodsServer) Search(ctx context.Context, in *goods.SearchRequest) (*goods.SearchResponse, error) {
	search, err := server.Search(in)
	if err != nil {
		return nil, err
	}
	return search, err
}

func (GoodsServer) HighlightSearch(ctx context.Context, in *goods.HighlightSearchRequest) (*goods.HighlightSearchResponse, error) {
	top, err := server.HighlightSearch(in)
	if err != nil {
		return nil, err
	}
	return top, err
}

func (GoodsServer) SearchForRecords(ctx context.Context, in *goods.SearchForRecordsRequest) (*goods.SearchForRecordsResponse, error) {
	search, err := server.SearchForRecords(in)
	if err != nil {
		return nil, err
	}
	return search, err
}

func (GoodsServer) ShoppingCart(ctx context.Context, in *goods.ShoppingCartRequest) (*goods.ShoppingCartResponse, error) {
	search, err := server.ShoppingCart(in)
	if err != nil {
		return nil, err
	}
	return search, err
}

func (GoodsServer) Comment(ctx context.Context, in *goods.CommentRequest) (*goods.CommentResponse, error) {
	comment, err := server.Comment(in)
	if err != nil {
		return nil, err
	}
	return comment, err
}

func (GoodsServer) CreateComment(ctx context.Context, in *goods.CreateCommentRequest) (*goods.CreateCommentResponse, error) {
	Create, err := server.CreateComment(in)
	if err != nil {
		return nil, err
	}
	return Create, err
}
